home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 37
/
Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso
/
Aminet
/
comm
/
mail
/
AEMail230.lha
/
aemail230
/
arexx
/
DB2ABK.aem
< prev
next >
Wrap
Text File
|
1998-09-25
|
2KB
|
78 lines
/* DB2ABK.aem Get email address from database and add to address book */
OPTIONS RESULTS
ADDTOAB = 1
IF (ADDTOAB = 1) THEN DO
OK = 0
DO UNTIL OK = 1
ADDRESS_BOOK LIST GROUP DESCRIPTION LF
grplist = RESULT
GETLISTITEM "'"grplist"' 'Select the Group Wanted'"
grpname = RESULT
IF (grpname = "") THEN ADDTOAB = 0
IF (ADDTOAB = 0) THEN LEAVE
PARSE VAR grpname grpname dflt
dflt = STRIP(dflt, 'L')
ADDRESS_BOOK GET grpname TYPE
addrtype = RESULT
IF (addrtype = -1) THEN DO
OKAY2 '"Create It|Enter New Name|Cancel"' "Group Nickname Does Not Exist"
IF (RESULT = 1) THEN DO
GETSTRING '"Enter a Group Description"' "'"dflt"'"
grpdesc = RESULT
OK = 1
OKAY2 "YES|NO" "Do you want to send header only?"
IF (RESULT = 0) THEN sndho = ""
ELSE sndho = "SHO"
END
ELSE IF (RESULT = 2) THEN OK = 0
ELSE IF (RESULT = 0) THEN exit
END
IF (addrtype = 0) THEN DO
OKAY2 '"Re-enter Name|Cancel"' "Nickname is already used for an Individual"
IF (RESULT = 1) THEN OK = 0
IF (RESULT = 0) THEN exit
END
IF (addrtype = 1) THEN OK = 1
END
END
IF ~ SHOW("PORTS","FINALD.1") THEN
DO
ADDRESS COMMAND "Run >NIL: FinalData:FinalData"
ADDRESS COMMAND "WaitForPort FINALD.1"
IF ~ SHOW("PORTS","FINALD.1") THEN
DO
OKAY1 "Final Data Did Not Load"
EXIT
END
END
ADDRESS "FINALD.1" ScreenToFront
ADDRESS "FINALD.1" Open
ADDRESS "FINALD.1" ShowAllColumns
ADDRESS "FINALD.1" NUMROWS
ENDROW = RESULT
ADDRESS "FINALD.1" GETCOLUMNPOSITION NAME 'email'
EMCOL = RESULT
DO CURROW = 1 TO ENDROW BY 1
ADDRESS "FINALD.1" CellData EMCOL CURROW
EMDATA = RESULT
IF EMDATA ~= "" THEN DO
IF (ADDTOAB = 1) THEN DO
IF (addrtype = -1) THEN DO
cmd = "ADDRESS_BOOK CREATE GROUP " grpname sndho EMDATA grpdesc
addrtype = 1
END
ELSE cmd = "ADDRESS_BOOK ADD TO GROUP " grpname EMDATA
cmd
END
END
END
ADDRESS "FINALD.1" QUIT
AEMAIL TO FRONT